package CompositedPattern.demo;

/**
 * @author： pang-yun
 * @date： 2021-12-27 14:55
 * 功能目的 ：用于
 */

public class Client {
    public static void main(String[] args) {
        // 大学
        OrganizedComponent university = new University("JiangSuUniversity", "ZhenJiang");
        // 学院
        OrganizedComponent agricultureCollege = new College("AgricultureCollege", "农业");
        OrganizedComponent computerCollege = new College("ComputerCollege", "计算机");
        //院系
        agricultureCollege.add(new Department("Machine", "机械"));
        agricultureCollege.add(new Department("Equipment", "装备"));

        computerCollege.add(new Department("soft", "软件"));
        computerCollege.add(new Department("test", "测试"));

        university.add(agricultureCollege);
        university.add(computerCollege);

        university.print();
    }
}
